import request from '@/utils/request'


export function getBrandById(id) {
  return request({
    url: `/product/brand/getById`,
    method: 'get',
    params: {id}
  })
}

export function saveCategoryBrand(data) {
  return request({
    url: '/product/categoryBrandRelation/save',
    method: 'post',
    data
  })
}

export function categoryBrandRelationList(categoryId) {
  return request({
    url: '/product/categoryBrandRelation/brands/list',
    method: 'get',
    params:{categoryId}
  })
}

export function saveBrand(data) {
  return request({
    url: '/product/brand/save',
    method: 'post',
    data
  })
}

export function updateBrand(data) {
  return request({
    url: '/product/brand/update',
    method: 'post',
    data
  })
}

export function categoryBrandList(params) {
  return request({
    url: '/product/categoryBrandRelation/category/list',
    method: 'get',
    params
  })
}

export function brandList(params) {
  return request({
    url: '/product/brand/find',
    method: 'get',
    params
  })
}

export function deleteCategoryBrand(ids) {
  return request({
    url: '/product/categoryBrandRelation/delete',
    method: 'post',
    data: ids
  })
}

export function deleteBrand(ids) {
  return request({
    url: '/product/brand/delete',
    method: 'post',
    data: ids
  })
}

